package utils;

import android.widget.Toast;

import common.MyApplication;

/**
 * Created by Administrator on 2017/3/1.
 */

public class ToastUtils {
    private static Toast toast;

    public static void shortToast(String content) {
        if (toast == null) {
            toast = Toast.makeText(MyApplication.getContext(), content, Toast.LENGTH_SHORT);
        } else {
            toast.setText(content);
            toast.setDuration(Toast.LENGTH_SHORT);
        }
        toast.show();
    }

    public static void cancelToast() {
        if (toast == null) {
        } else {
            toast.cancel();
        }
    }
}
